DB_CFG = {
    'host': None,
    'port': 3306,
    'password': None,
    'user': None,
    'db': None,
}

from ._rdb import now, MysqlLiteral
from .api import get, add, mod, remove, join, sql, one


def init(**cfg):
    global DB_CFG
    DB_CFG.update(cfg)


def init_app(app):
    init(host=app.config['DB_HOST'],
         port=app.config['DB_PORT'],
         user=app.config['DB_USER'],
         password=app.config['DB_PASS'],
         db=app.config['DB_NAME'])
